package moni.anyou.com.view.config;

import android.app.Application;
import android.content.Context;

//import com.tencent.mm.opensdk.openapi.IWXAPI;
//import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import androidx.multidex.MultiDexApplication;

import com.tencent.imsdk.TIMGroupReceiveMessageOpt;
import com.tencent.imsdk.TIMManager;
import com.tencent.imsdk.TIMOfflinePushListener;
import com.tencent.imsdk.TIMOfflinePushNotification;
import com.tencent.mm.sdk.openapi.IWXAPI;
import com.tencent.mm.sdk.openapi.WXAPIFactory;
import com.tencent.qalsdk.sdk.MsfSdkUtils;
import com.tencent.qcloud.timchat.TimApplication;
import com.tencent.qcloud.timchat.TimApplication;
import com.tencent.qcloud.tlslibrary.service.TLSService;
import com.tencent.qcloud.tlslibrary.service.TlsBusiness;
import com.tencent.qcloud.ui.ChatInput;

//import io.agora.largegroupcall.model.WorkerThread;
import io.agora.openlive.AgoraApplication;
import moni.anyou.com.view.R;
import moni.anyou.com.view.tim.TimSdk;
import moni.anyou.com.view.tool.DBUtils;
import moni.anyou.com.view.tool.CrashHandler;
import moni.anyou.com.view.view.ConfirmChatDialogActivity;
//import moni.anyou.com.view.view.VideoChatViewActivity;
//import moni.anyou.com.view.view.VoiceChatViewActivity;

/**
 * Created by lubiao on 2016/10/28.
 */
public class AnyouerApplication extends AgoraApplication{
    private static Context mAppApplication;
    public static DBUtils db;
    public static IWXAPI mIWXAPI = null;


//    private WorkerThread mWorkerThread;
//
//    public synchronized void initWorkerThread() {
//        if (mWorkerThread == null) {
//            mWorkerThread = new WorkerThread(getApplicationContext());
//            mWorkerThread.start();
//
//            mWorkerThread.waitForReady();
//        }
//    }
//
//    public synchronized WorkerThread getWorkerThread() {
//        return mWorkerThread;
//    }
//
//    public synchronized void deInitWorkerThread() {
//        mWorkerThread.exit();
//        try {
//            mWorkerThread.join();
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//        mWorkerThread = null;
//    }

    @Override
    public void onCreate() {
        super.onCreate();
//        initWorkerThread();


//
//        CrashHandler catchHandler = CrashHandler.getInstance();
//        catchHandler.init(getApplicationContext());
        if (SysConfig.prefs == null) {
            SysConfig.prfsName = "Anyouer" + SysConfig.VersionId;
            SysConfig.prefs = getSharedPreferences(SysConfig.prfsName, 0);

            SysConfig.uid=SysConfig.prefs.getString("sUser_id", "0");
            SysConfig.userSig=SysConfig.prefs.getString("userSig", "0");

        }
        mAppApplication = this;
        db = new DBUtils(this);


        TimSdk.init(this);



//        /**初始化关联语音视频聊天类*/
//        ChatInput.initChatRoomCla(ConfirmChatDialogActivity.class,VoiceChatViewActivity.class,VideoChatViewActivity.class);



    }


   public static Context getAppContext() {
        return mAppApplication;
    }
}
